package com.itheima.springboot_24_mq.service.impl;

import com.itheima.springboot_24_mq.service.MessageService;
import com.itheima.springboot_24_mq.service.OrderService;
//import com.itheima.springboot_24_mq.service.impl.base.MessageServiceImpl;
import com.itheima.springboot_24_mq.service.impl.rabbitmq.direct.MessageServiceRabbitmqImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired//自动装配,依赖类需要有@Service
    //@Repository //作用跟Component一样,只是多用于dao目录下的类
    //                Component多用于pojo目录下的类
    //@Serivce //作用跟Component一样,只是多用于service目录下的类
    //@Controller //作用跟Component一样,只是多用于Controller目录下的类
    private MessageService messageService;

    @Override
    public void order(String id) {
        //订单处理开始
        System.out.println("service order start ");
        messageService.sendMessage(id);//把要发送短信的id放入队列中
        //订单处理结束
        System.out.println("service order stop ");
    }
}
